package com.os.ordersystem.service.impl;

import com.os.ordersystem.bean.Food;
import com.os.ordersystem.mapper.FoodMapper;
import com.os.ordersystem.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class FoodServiceImpl implements FoodService {

    @Autowired
    private FoodMapper foodMapper;

    @Override
    public int addFood(Food food) {
        return foodMapper.addFood(food);
    }

    @Override
    public int delFoodById(Integer id) {

        return foodMapper.delFoodById(id);
    }

    @Override
    public int updateFood(Food food) {
        return foodMapper.updateFood(food);
    }


    @Override
    public List<Food> getByPage(Map<String, Object> map) {

        return foodMapper.getByPage(map);
    }

    @Override
    public long getTotal(String foodName, Integer foodType) {
        return foodMapper.getTotal(foodName, foodType);
    }

    @Override
    public Food selectFoodById(Integer key) {
        return foodMapper.selectFoodById(key);
    }

}
